
#include "position.h"

class entity {
public:
	position pos;
	position size;
	position motion;
	bool moving;

	entity() {

	}

	~entity() {
	}

	virtual void update() {
		moving = move();
	}

	virtual void render(int x, int y) {

	}

	bool move() {
		bool flag = true;
		if(isCollision(motion.X, motion.Y)) {
			if(isCollision(motion.X, 0)) motion.X = 0;
			if(isCollision(0, motion.Y)) motion.Y = 0; 
		}
		pos.X += motion.X;
		pos.Y += motion.Y;
		motion.X /= 2;
		motion.Y /= 2;
		return flag;
	}

	bool isCollision(int x, int y) {

		return false;
	}
protected:
private:
};